]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
format: move shell_format_int_alternative_output() to ShellJS
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 10 Apr 2012 15:21:19 +0000 (11:21 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 10 Apr 2012 16:52:33 +0000 (12:52 -0400)
gnome-shell-extension-prefs uses format(), but can't pull in Shell
(which is a dependency for the module), since that in turn would pull in
Meta. Fix this by moving the introspected int format function to ShellJS
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=673106

js/misc/format.js
src/shell-js.c
src/shell-js.h
src/shell-util.c
src/shell-util.h

index 74972ac7f9bc2a5f2b02249107427be3de88f277..c30a1bac037798418253c367cec24a93b7e1aeb5 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const Shell = imports.gi.Shell;
+const ShellJS = imports.gi.ShellJS;
 
 /*
  * This function is intended to extend the String object and provide
@@ -50,7 +50,7 @@ function format() {
                         case 'd':
                             let intV = parseInt(args[i++]);
                             if (hasAlternativeIntFlag)
-                                s = Shell.format_int_alternative_output(intV);
+                                s = ShellJS.format_int_alternative_output(intV);
                             else
                                 s = intV.toString();
                             break;
index 8267fdc98b2f9fcf5ded6e4541487319956f8484..6657b48799e7386e4a89ad2aa4732b65a83da242 100644 (file)
@@ -79,3 +79,15 @@ shell_js_add_extension_importer (const char  *target_object_script,
   JS_EndRequest (context);
   return ret;
 }
+
+/**
+ * shell_js_format_int_alternative_output:
+ * @intval:
+ *
+ * Returns: (transfer full):
+ */
+gchar *
+shell_js_format_int_alternative_output (gint intval)
+{
+  return g_strdup_printf ("%Id", intval);
+}
index 26cbf4d82d9f2ece2b00d212715e95e38037d530..fd8530480b7828179809477c933f8ab9626d0f7e 100644 (file)
@@ -11,6 +11,8 @@ gboolean shell_js_add_extension_importer (const char   *target_object_script,
                                           const char   *directory,
                                           GError      **error);
 
+gchar   *shell_js_format_int_alternative_output (gint intval);
+
 G_BEGIN_DECLS
 
 #endif /* __SHELL_JS_H__ */
index e7be8129b7c4c3f1a2aceef784e9dd1515f99c9a..0a1baab39b5d78331ad67a15a26999038d2cda0b 100644 (file)
@@ -868,15 +868,3 @@ shell_util_wifexited (int  status,
 
   return ret;
 }
-
-/**
- * shell_format_int_alternative_output:
- * @intval:
- *
- * Returns: (transfer full):
- */
-gchar *
-shell_format_int_alternative_output (gint intval)
-{
-  return g_strdup_printf ("%Id", intval);
-}
index 2b21886a67d9a363c5c0d52a97ee1ef60fcf15d4..9208099ad15a5539c16d02a59ef51a1756da215d 100644 (file)
@@ -52,8 +52,6 @@ gboolean shell_session_is_active_for_systemd (void);
 gboolean shell_util_wifexited                  (int               status,
                                                 int              *exit);
 
-gchar    *shell_format_int_alternative_output  (gint              intval);
-
 
 G_END_DECLS